#ifndef _THREADPOOL_H
#define _THREADPOOL_H

#include "Runnable.h"
#include "Thread.h"
#include <list>

using namespace std;

namespace concurrent
{
class ThreadPool
{
public:
	virtual ~ThreadPool(void);
	Thread* execute(Runnable*);
	void release(void);
	static ThreadPool* getInstance(void);
protected:
	Thread* createThread(void);
	Thread* createThread(Runnable*);
private:
	ThreadPool(void);
	list<Thread*> threads;
	static bool _initialised;
	static ThreadPool _instance;
};
};

#endif
